home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2244 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  762 b 

  1. Path: lince.lander.es!news
  2. From: piqueras@lander.es (Alvaro Piqueras)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: warning: possibly incorrect assignment
  5. Date: Sat, 20 Jan 1996 01:14:56 GMT
  6. Organization: Lander Internet
  7. Message-ID: <31004209.2723565@news.lander.es>
  8. References: <Pine.OSF.3.91.960109091920.6447A-100000@io.UWinnipeg.ca>
  9. NNTP-Posting-Host: ppp003.lander.es
  10. X-Newsreader: Forte Agent .99c/16.141
  11.  
  12. Bill Simpson <wsimpson@uwinnipeg.ca> wrote:
  13.  
  14. >I get the above warning when I compile code using the following
  15. >function.  It flags the **** line.
  16.  
  17. >****        while(fp=fopen(file_name,"r"))
  18.  
  19. >How can I write this code so the compiler does not issue this warning?
  20.  
  21. Try:
  22.  
  23. while(( fp = fopen( file_name,"r" )) != NULL );
  24.  
  25. It *should* work...
  26.  
  27. cheers.
  28.  
  29. Alvaro.
  30.  
  31.